home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok82.lha
/
Printf1.4
/
Printf.s
< prev
next >
Wrap
Text File
|
1993-08-15
|
2KB
|
101 lines
; :Program. Printf.s
; :Author. Volker Rudolph
; :Address. Lettow-Vorbeck-Str. 11 / 6750 Kaiserslautern 26
; :Phone. 06301/8566
; :Version. 1.0
; :Date. 28.11.1989
; :Copyright. PD
; :Language. Assembler / Oberon
; :Translator. A68k(Freeware) / Amiga-Oberon V1.17.1
; :Contents. Allzweck-Textausgabe in Form der C-Funktion Printf
; :Usage. Aufruf und Parameter wie in C
XREF OberonLib.StackChk
XREF Printf_SPrintf,Printf.WriteProc
XDEF Printf.Printf0,Printf.Printf1,Printf.Printf2,Printf.Printf3,Printf.Printf4,
XDEF Printf.Printf5,Printf.Printf6
bufSize EQU 120 ; Size of output-buffer
SECTION Module,CODE
Printf.Printf0:
moveq #0,d7
bra.s Printf
Printf.Printf1:
moveq #1,d7
bra.s Printf
Printf.Printf2:
moveq #2,d7
bra.s Printf
Printf.Printf3:
moveq #3,d7
bra.s Printf
Printf.Printf4:
moveq #4,d7
bra.s Printf
Printf.Printf5:
moveq #5,d7
bra.s Printf
Printf.Printf6:
moveq #6,d7
;bra.s Printf
Printf: ;d7: Anzahl Parameter
move.l d7,d0
lsl.l #2,d0
add.l #bufSize+44,d1 ; 11 Register
jsr OberonLib.StackChk
movem.l d2-d7/a2-a6,-(sp)
lea.l -bufSize(sp),sp
move.l sp,d4 ;d4: Ausgabe-Puffer
move.l d7,d0 ;d0: Schleifen-Zähler
subq.l #1,d0
move.l d7,d1 ;d1: Kopier-Offset
lsl.l #2,d1
move.l d1,d2
add.l #28+44+bufSize,d1 ; 28 = 4+3*(4+4)
addq.l #6,d2
move.l d2,-(sp)
moveq.l #bufSize-1,d3 ;Parameter für SPrintf(buffer,,,,) und
move.l d4,-(sp) ;writeProc(buffer) auf den Stack legen
move.l d3,-(sp)
move.l d4,-(sp) ;writeProc(buffer) auf den Stack legen
move.l d3,-(sp)
move.l 0(sp,d1.l),-(sp) ;str
move.l 4(sp,d1.l),-(sp)
tst.l d7
beq.s noArgs
loop:
move.l 0(sp,d1.l),-(sp)
dbra d0,loop
noArgs:
jsr Printf_SPrintf ;Sprintf aufrufen
jsr Printf.WriteProc
move.l (sp)+,d0
^ lea.l bufSize(sp),sp
movem.l (sp)+,d2-d7/a2-a6
move.l (sp)+,a0
add.l d0,sp
jmp (a0)
END